package cn.duyo.spring.context.event;

import cn.duyo.spring.context.ApplicationEvent;
import cn.duyo.spring.context.ApplicationListener;

/**
 * 事件广播器接口 (事件发布者)
 *
 * @author du
 */
public interface ApplicationEventMulticaster {

    /**
     * Add a listener to be notified of all events.
     * @param listener the listener to add
     */
    void addApplicationListener(ApplicationListener<?> listener);

    /**
     * Remove a listener from the notification list.
     * @param listener the listener to remove
     */
    void removeApplicationListener(ApplicationListener<?> listener);

    /**
     * 广播事件给所有监听者
     */
    void multicastEvent(ApplicationEvent event);

}
